<?php 
include('includes/confirm.php');
$page_name = media;
require_once 'classes/Mysql.php';
//require_once 'includes/constants.php';
$mysql = New Mysql();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <?php include('includes/head.php'); ?>
<body>
<div id="wrapper">
    <?php include('includes/header.php'); ?>
    <?php include('includes/menu.php'); ?>
    
    <div id="page">
    	
	      <div id="content">
			<form method="post" action="added_copy.php">
				<div id="browse_result">
				
				<?php
					if($_POST && !empty($_POST['resource_id']) && !empty($_POST['type_id']) && !empty($_POST['condition']) && !empty($_POST['format_id']) && !empty($_POST['share_level']) && !empty($_POST['location']) ){
							$query = "INSERT INTO resource_copy (`u_id`, `resource_id`, `condition`, `share_level`, `location`, `format_id`)
																				VALUES ('".$_SESSION['userid']."', '".$_POST['resource_id']."', '".$_POST['condition']."', '".$_POST['share_level']."', '".$_POST['location']."', '".$_POST['format_id']."' )";
							
							$mysql->run_query_string($query);
							
							echo "<h3>ADDED COPY!</h4>";
						}
				?>
				
				</div>
	      </div>
	      <!-- end div#content -->
	      <div id="sidebar">
			
	      </div>
	      <!-- end div#sidebar -->
	      <div style="clear: both; height: 1px"></div>
	   
	  </div>
  
  	</div>
  	<!-- end div#page -->
    <?php include('includes/footer.php'); ?>
</div> <!-- end div#wrapper -->
</body>
</html>
